<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return=array();
if($_RQ['op']=='main'){	
	$id = intval($_RQ['id']);
		if (empty($id)) 
		{
			exi('参数错误','error','/index/');
		}
		$board = pdo_get('jy_sns_board',array('id'=>$id));
		if (empty($board)) 
		{	
			exi('未找到版块','error','/index/');	
		}
		$catelist = pdo_getall('jy_sns_complaincate',array('uniacid'=>$_SESSION['uniacid']));
		$member = pdo_get('core_members',array('id'=>$_SESSION['uid']));
		$isManager = isManager($board['id']);
		$isSuperManager = isSuperManager();
		if (!($isManager) && !($isSuperManager)) 
		{
			$check = check($member, $board);			
		}
		$return['board']=$board;
		$return['member']=$member;
		$return['check']=$check;
		$return['catelist']=$catelist;
		$return['params']=array('order'=>'tuijie');
		exi($return);
}
if($_RQ['op']=='good'){
$post=get_postdata();
$id =$post['id'];
	if (empty($id)) 
	{
		exi('参数错误','error','/index/');
	}
	$l=pdo_get('jy_sns_like',array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid'],'pid'=>$id));
	if($l){
		exi('您已点赞','error');
	}
	pdo_insert('jy_sns_like',array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid'],'pid'=>$id));
	exi('点赞成功','error');
}
?>